package nl.sanity.events
{
	import flash.net.URLLoader;
	import flash.events.Event;
	
	/**
	 * QueueLoaderEvent
	 * For usage in combination with the QueueLoader class
	 * 
	 * @langversion ActionScript 3
	 *
	 * @author M.P. Bartnig
	 * @since  28/03/2009
	 */
	public class QueueLoaderEvent extends Event
	{
		public static const ON_LOAD_START			: String	= "onLoadStart";
		public static const ON_LOAD_PROGRESS		: String	= "onLoadProgress";
		public static const ON_LOAD_COMPLETE		: String	= "onLoadComplete";
		public static const ON_ITEM_LOAD_START		: String	= "onItemLoadStart";
		public static const ON_ITEM_LOAD_PROGRESS	: String	= "onItemLoadProgress";
		public static const ON_ITEM_LOAD_COMPLETE	: String	= "onItemLoadComplete";
		public static const ON_ITEM_LOAD_ERROR		: String	= "onItemLoadError";
		
		
		private var _data							: Object;
		private var _error							: Object;
		
		// --- CONSTRUCTOR ----------------------------------------

		public function QueueLoaderEvent( type:String, data:Object = null, error:Object = null, bubbles:Boolean = false, cancelable:Boolean = false )
		{
			_data 	= data;
			_error 	= error;
			
			super ( type, bubbles, cancelable );
		}
		
		/**
		 * Creates and returns a copy of the current instance.
		 * @return a copy of the current instance.
		 */
		public override function clone():Event
		{
			return new QueueLoaderEvent( type, _data, _error, bubbles, cancelable );
		}
		
		// --- GETTERS/SETTERS ----------------------------------------

		public function get data():Object
		{
			return _data;
		}
		
		public function get error():Object
		{
			return _error;
		}
		
	}
}